﻿#pragma warning disable 1591

using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Net;
using System.Net.NetworkInformation;
using System.Text;
using System.Timers;
using System.Web;
using System.Xml;
using FreeMi;
using OpenSource.UPnP;
using System.Globalization;
using System.Reflection;

namespace FreeMi.Core
{
    class ContentDirectoryService : IUPnPService
    {
        #region AutoGenerated Code Section [Do NOT Modify, unless you know what you're doing]
        //{{{{{ Begin Code Block

        private _ContentDirectoryService _S;
        public static string URN = "urn:schemas-upnp-org:service:ContentDirectory:1";
        public double VERSION
        {
            get
            {
                return (double.Parse(_S.GetUPnPService().Version));
            }
        }

        public enum Enum_A_ARG_TYPE_BrowseFlag
        {
            BROWSEMETADATA,
            BROWSEDIRECTCHILDREN,
        }
        public Enum_A_ARG_TYPE_BrowseFlag A_ARG_TYPE_BrowseFlag
        {
            set
            {
                string v = "";
                switch (value)
                {
                    case Enum_A_ARG_TYPE_BrowseFlag.BROWSEMETADATA:
                        v = "BrowseMetadata";
                        break;
                    case Enum_A_ARG_TYPE_BrowseFlag.BROWSEDIRECTCHILDREN:
                        v = "BrowseDirectChildren";
                        break;
                }
                _S.SetStateVariable("A_ARG_TYPE_BrowseFlag", v);
            }
            get
            {
                Enum_A_ARG_TYPE_BrowseFlag RetVal = 0;
                string v = (string)_S.GetStateVariable("A_ARG_TYPE_BrowseFlag");
                switch (v)
                {
                    case "BrowseMetadata":
                        RetVal = Enum_A_ARG_TYPE_BrowseFlag.BROWSEMETADATA;
                        break;
                    case "BrowseDirectChildren":
                        RetVal = Enum_A_ARG_TYPE_BrowseFlag.BROWSEDIRECTCHILDREN;
                        break;
                }
                return (RetVal);
            }
        }
        static public string Enum_A_ARG_TYPE_BrowseFlag_ToString(Enum_A_ARG_TYPE_BrowseFlag en)
        {
            string RetVal = "";
            switch (en)
            {
                case Enum_A_ARG_TYPE_BrowseFlag.BROWSEMETADATA:
                    RetVal = "BrowseMetadata";
                    break;
                case Enum_A_ARG_TYPE_BrowseFlag.BROWSEDIRECTCHILDREN:
                    RetVal = "BrowseDirectChildren";
                    break;
            }
            return (RetVal);
        }
        static public string[] Values_A_ARG_TYPE_BrowseFlag
        {
            get
            {
                string[] RetVal = new string[2] { "BrowseDirectChildren", "BrowseMetadata" };
                return (RetVal);
            }
        }
        public delegate void OnStateVariableModifiedHandler(ContentDirectoryService sender);
        public event OnStateVariableModifiedHandler OnStateVariableModified_SearchCapabilities;
        public event OnStateVariableModifiedHandler OnStateVariableModified_A_ARG_TYPE_SortCriteria;
        public event OnStateVariableModifiedHandler OnStateVariableModified_A_ARG_TYPE_SearchCriteria;
        public event OnStateVariableModifiedHandler OnStateVariableModified_A_ARG_TYPE_Filter;
        public event OnStateVariableModifiedHandler OnStateVariableModified_SortCapabilities;
        public event OnStateVariableModifiedHandler OnStateVariableModified_A_ARG_TYPE_ObjectID;
        public event OnStateVariableModifiedHandler OnStateVariableModified_SystemUpdateID;
        public event OnStateVariableModifiedHandler OnStateVariableModified_A_ARG_TYPE_BrowseFlag;
        public event OnStateVariableModifiedHandler OnStateVariableModified_A_ARG_TYPE_UpdateID;
        public event OnStateVariableModifiedHandler OnStateVariableModified_ContainerUpdateIDs;
        public event OnStateVariableModifiedHandler OnStateVariableModified_TransferIDs;
        public event OnStateVariableModifiedHandler OnStateVariableModified_A_ARG_TYPE_Index;
        public event OnStateVariableModifiedHandler OnStateVariableModified_A_ARG_TYPE_Count;
        public event OnStateVariableModifiedHandler OnStateVariableModified_A_ARG_TYPE_Result;
        public System.String SearchCapabilities
        {
            get
            {
                return ((System.String)_S.GetStateVariable("SearchCapabilities"));
            }
            set
            {
                _S.SetStateVariable("SearchCapabilities", value);
            }
        }
        public System.String A_ARG_TYPE_SortCriteria
        {
            get
            {
                return ((System.String)_S.GetStateVariable("A_ARG_TYPE_SortCriteria"));
            }
            set
            {
                _S.SetStateVariable("A_ARG_TYPE_SortCriteria", value);
            }
        }
        public System.String A_ARG_TYPE_SearchCriteria
        {
            get
            {
                return ((System.String)_S.GetStateVariable("A_ARG_TYPE_SearchCriteria"));
            }
            set
            {
                _S.SetStateVariable("A_ARG_TYPE_SearchCriteria", value);
            }
        }
        public System.String A_ARG_TYPE_Filter
        {
            get
            {
                return ((System.String)_S.GetStateVariable("A_ARG_TYPE_Filter"));
            }
            set
            {
                _S.SetStateVariable("A_ARG_TYPE_Filter", value);
            }
        }
        public System.String SortCapabilities
        {
            get
            {
                return ((System.String)_S.GetStateVariable("SortCapabilities"));
            }
            set
            {
                _S.SetStateVariable("SortCapabilities", value);
            }
        }
        public System.String A_ARG_TYPE_ObjectID
        {
            get
            {
                return ((System.String)_S.GetStateVariable("A_ARG_TYPE_ObjectID"));
            }
            set
            {
                _S.SetStateVariable("A_ARG_TYPE_ObjectID", value);
            }
        }
        public System.UInt32 Evented_SystemUpdateID
        {
            get
            {
                return ((System.UInt32)_S.GetStateVariable("SystemUpdateID"));
            }
            set
            {
                _S.SetStateVariable("SystemUpdateID", value);
            }
        }
        public System.UInt32 A_ARG_TYPE_UpdateID
        {
            get
            {
                return ((System.UInt32)_S.GetStateVariable("A_ARG_TYPE_UpdateID"));
            }
            set
            {
                _S.SetStateVariable("A_ARG_TYPE_UpdateID", value);
            }
        }
        public System.String Evented_ContainerUpdateIDs
        {
            get
            {
                return ((System.String)_S.GetStateVariable("ContainerUpdateIDs"));
            }
            set
            {
                _S.SetStateVariable("ContainerUpdateIDs", value);
            }
        }
        public System.String Evented_TransferIDs
        {
            get
            {
                return ((System.String)_S.GetStateVariable("TransferIDs"));
            }
            set
            {
                _S.SetStateVariable("TransferIDs", value);
            }
        }
        public System.UInt32 A_ARG_TYPE_Index
        {
            get
            {
                return ((System.UInt32)_S.GetStateVariable("A_ARG_TYPE_Index"));
            }
            set
            {
                _S.SetStateVariable("A_ARG_TYPE_Index", value);
            }
        }
        public System.UInt32 A_ARG_TYPE_Count
        {
            get
            {
                return ((System.UInt32)_S.GetStateVariable("A_ARG_TYPE_Count"));
            }
            set
            {
                _S.SetStateVariable("A_ARG_TYPE_Count", value);
            }
        }
        public System.String A_ARG_TYPE_Result
        {
            get
            {
                return ((System.String)_S.GetStateVariable("A_ARG_TYPE_Result"));
            }
            set
            {
                _S.SetStateVariable("A_ARG_TYPE_Result", value);
            }
        }
        public UPnPModeratedStateVariable.IAccumulator Accumulator_SearchCapabilities
        {
            get
            {
                return (((UPnPModeratedStateVariable)_S.GetUPnPService().GetStateVariableObject("SearchCapabilities")).Accumulator);
            }
            set
            {
                ((UPnPModeratedStateVariable)_S.GetUPnPService().GetStateVariableObject("SearchCapabilities")).Accumulator = value;
            }
        }
        public double ModerationDuration_SearchCapabilities
        {
            get
            {
                return (((UPnPModeratedStateVariable)_S.GetUPnPService().GetStateVariableObject("SearchCapabilities")).ModerationPeriod);
            }
            set
            {
                ((UPnPModeratedStateVariable)_S.GetUPnPService().GetStateVariableObject("SearchCapabilities")).ModerationPeriod = value;
            }
        }
        public UPnPModeratedStateVariable.IAccumulator Accumulator_A_ARG_TYPE_SortCriteria
        {
            get
            {
                return (((UPnPModeratedStateVariable)_S.GetUPnPService().GetStateVariableObject("A_ARG_TYPE_SortCriteria")).Accumulator);
            }
            set
            {
                ((UPnPModeratedStateVariable)_S.GetUPnPService().GetStateVariableObject("A_ARG_TYPE_SortCriteria")).Accumulator = value;
            }
        }
        public double ModerationDuration_A_ARG_TYPE_SortCriteria
        {
            get
            {
                return (((UPnPModeratedStateVariable)_S.GetUPnPService().GetStateVariableObject("A_ARG_TYPE_SortCriteria")).ModerationPeriod);
            }
            set
            {
                ((UPnPModeratedStateVariable)_S.GetUPnPService().GetStateVariableObject("A_ARG_TYPE_SortCriteria")).ModerationPeriod = value;
            }
        }
        public UPnPModeratedStateVariable.IAccumulator Accumulator_A_ARG_TYPE_SearchCriteria
        {
            get
            {
                return (((UPnPModeratedStateVariable)_S.GetUPnPService().GetStateVariableObject("A_ARG_TYPE_SearchCriteria")).Accumulator);
            }
            set
            {
                ((UPnPModeratedStateVariable)_S.GetUPnPService().GetStateVariableObject("A_ARG_TYPE_SearchCriteria")).Accumulator = value;
            }
        }
        public double ModerationDuration_A_ARG_TYPE_SearchCriteria
        {
            get
            {
                return (((UPnPModeratedStateVariable)_S.GetUPnPService().GetStateVariableObject("A_ARG_TYPE_SearchCriteria")).ModerationPeriod);
            }
            set
            {
                ((UPnPModeratedStateVariable)_S.GetUPnPService().GetStateVariableObject("A_ARG_TYPE_SearchCriteria")).ModerationPeriod = value;
            }
        }
        public UPnPModeratedStateVariable.IAccumulator Accumulator_A_ARG_TYPE_Filter
        {
            get
            {
                return (((UPnPModeratedStateVariable)_S.GetUPnPService().GetStateVariableObject("A_ARG_TYPE_Filter")).Accumulator);
            }
            set
            {
                ((UPnPModeratedStateVariable)_S.GetUPnPService().GetStateVariableObject("A_ARG_TYPE_Filter")).Accumulator = value;
            }
        }
        public double ModerationDuration_A_ARG_TYPE_Filter
        {
            get
            {
                return (((UPnPModeratedStateVariable)_S.GetUPnPService().GetStateVariableObject("A_ARG_TYPE_Filter")).ModerationPeriod);
            }
            set
            {
                ((UPnPModeratedStateVariable)_S.GetUPnPService().GetStateVariableObject("A_ARG_TYPE_Filter")).ModerationPeriod = value;
            }
        }
        public UPnPModeratedStateVariable.IAccumulator Accumulator_SortCapabilities
        {
            get
            {
                return (((UPnPModeratedStateVariable)_S.GetUPnPService().GetStateVariableObject("SortCapabilities")).Accumulator);
            }
            set
            {
                ((UPnPModeratedStateVariable)_S.GetUPnPService().GetStateVariableObject("SortCapabilities")).Accumulator = value;
            }
        }
        public double ModerationDuration_SortCapabilities
        {
            get
            {
                return (((UPnPModeratedStateVariable)_S.GetUPnPService().GetStateVariableObject("SortCapabilities")).ModerationPeriod);
            }
            set
            {
                ((UPnPModeratedStateVariable)_S.GetUPnPService().GetStateVariableObject("SortCapabilities")).ModerationPeriod = value;
            }
        }
        public UPnPModeratedStateVariable.IAccumulator Accumulator_A_ARG_TYPE_ObjectID
        {
            get
            {
                return (((UPnPModeratedStateVariable)_S.GetUPnPService().GetStateVariableObject("A_ARG_TYPE_ObjectID")).Accumulator);
            }
            set
            {
                ((UPnPModeratedStateVariable)_S.GetUPnPService().GetStateVariableObject("A_ARG_TYPE_ObjectID")).Accumulator = value;
            }
        }
        public double ModerationDuration_A_ARG_TYPE_ObjectID
        {
            get
            {
                return (((UPnPModeratedStateVariable)_S.GetUPnPService().GetStateVariableObject("A_ARG_TYPE_ObjectID")).ModerationPeriod);
            }
            set
            {
                ((UPnPModeratedStateVariable)_S.GetUPnPService().GetStateVariableObject("A_ARG_TYPE_ObjectID")).ModerationPeriod = value;
            }
        }
        public UPnPModeratedStateVariable.IAccumulator Accumulator_SystemUpdateID
        {
            get
            {
                return (((UPnPModeratedStateVariable)_S.GetUPnPService().GetStateVariableObject("SystemUpdateID")).Accumulator);
            }
            set
            {
                ((UPnPModeratedStateVariable)_S.GetUPnPService().GetStateVariableObject("SystemUpdateID")).Accumulator = value;
            }
        }
        public double ModerationDuration_SystemUpdateID
        {
            get
            {
                return (((UPnPModeratedStateVariable)_S.GetUPnPService().GetStateVariableObject("SystemUpdateID")).ModerationPeriod);
            }
            set
            {
                ((UPnPModeratedStateVariable)_S.GetUPnPService().GetStateVariableObject("SystemUpdateID")).ModerationPeriod = value;
            }
        }
        public UPnPModeratedStateVariable.IAccumulator Accumulator_A_ARG_TYPE_BrowseFlag
        {
            get
            {
                return (((UPnPModeratedStateVariable)_S.GetUPnPService().GetStateVariableObject("A_ARG_TYPE_BrowseFlag")).Accumulator);
            }
            set
            {
                ((UPnPModeratedStateVariable)_S.GetUPnPService().GetStateVariableObject("A_ARG_TYPE_BrowseFlag")).Accumulator = value;
            }
        }
        public double ModerationDuration_A_ARG_TYPE_BrowseFlag
        {
            get
            {
                return (((UPnPModeratedStateVariable)_S.GetUPnPService().GetStateVariableObject("A_ARG_TYPE_BrowseFlag")).ModerationPeriod);
            }
            set
            {
                ((UPnPModeratedStateVariable)_S.GetUPnPService().GetStateVariableObject("A_ARG_TYPE_BrowseFlag")).ModerationPeriod = value;
            }
        }
        public UPnPModeratedStateVariable.IAccumulator Accumulator_A_ARG_TYPE_UpdateID
        {
            get
            {
                return (((UPnPModeratedStateVariable)_S.GetUPnPService().GetStateVariableObject("A_ARG_TYPE_UpdateID")).Accumulator);
            }
            set
            {
                ((UPnPModeratedStateVariable)_S.GetUPnPService().GetStateVariableObject("A_ARG_TYPE_UpdateID")).Accumulator = value;
            }
        }
        public double ModerationDuration_A_ARG_TYPE_UpdateID
        {
            get
            {
                return (((UPnPModeratedStateVariable)_S.GetUPnPService().GetStateVariableObject("A_ARG_TYPE_UpdateID")).ModerationPeriod);
            }
            set
            {
                ((UPnPModeratedStateVariable)_S.GetUPnPService().GetStateVariableObject("A_ARG_TYPE_UpdateID")).ModerationPeriod = value;
            }
        }
        public UPnPModeratedStateVariable.IAccumulator Accumulator_ContainerUpdateIDs
        {
            get
            {
                return (((UPnPModeratedStateVariable)_S.GetUPnPService().GetStateVariableObject("ContainerUpdateIDs")).Accumulator);
            }
            set
            {
                ((UPnPModeratedStateVariable)_S.GetUPnPService().GetStateVariableObject("ContainerUpdateIDs")).Accumulator = value;
            }
        }
        public double ModerationDuration_ContainerUpdateIDs
        {
            get
            {
                return (((UPnPModeratedStateVariable)_S.GetUPnPService().GetStateVariableObject("ContainerUpdateIDs")).ModerationPeriod);
            }
            set
            {
                ((UPnPModeratedStateVariable)_S.GetUPnPService().GetStateVariableObject("ContainerUpdateIDs")).ModerationPeriod = value;
            }
        }
        public UPnPModeratedStateVariable.IAccumulator Accumulator_TransferIDs
        {
            get
            {
                return (((UPnPModeratedStateVariable)_S.GetUPnPService().GetStateVariableObject("TransferIDs")).Accumulator);
            }
            set
            {
                ((UPnPModeratedStateVariable)_S.GetUPnPService().GetStateVariableObject("TransferIDs")).Accumulator = value;
            }
        }
        public double ModerationDuration_TransferIDs
        {
            get
            {
                return (((UPnPModeratedStateVariable)_S.GetUPnPService().GetStateVariableObject("TransferIDs")).ModerationPeriod);
            }
            set
            {
                ((UPnPModeratedStateVariable)_S.GetUPnPService().GetStateVariableObject("TransferIDs")).ModerationPeriod = value;
            }
        }
        public UPnPModeratedStateVariable.IAccumulator Accumulator_A_ARG_TYPE_Index
        {
            get
            {
                return (((UPnPModeratedStateVariable)_S.GetUPnPService().GetStateVariableObject("A_ARG_TYPE_Index")).Accumulator);
            }
            set
            {
                ((UPnPModeratedStateVariable)_S.GetUPnPService().GetStateVariableObject("A_ARG_TYPE_Index")).Accumulator = value;
            }
        }
        public double ModerationDuration_A_ARG_TYPE_Index
        {
            get
            {
                return (((UPnPModeratedStateVariable)_S.GetUPnPService().GetStateVariableObject("A_ARG_TYPE_Index")).ModerationPeriod);
            }
            set
            {
                ((UPnPModeratedStateVariable)_S.GetUPnPService().GetStateVariableObject("A_ARG_TYPE_Index")).ModerationPeriod = value;
            }
        }
        public UPnPModeratedStateVariable.IAccumulator Accumulator_A_ARG_TYPE_Count
        {
            get
            {
                return (((UPnPModeratedStateVariable)_S.GetUPnPService().GetStateVariableObject("A_ARG_TYPE_Count")).Accumulator);
            }
            set
            {
                ((UPnPModeratedStateVariable)_S.GetUPnPService().GetStateVariableObject("A_ARG_TYPE_Count")).Accumulator = value;
            }
        }
        public double ModerationDuration_A_ARG_TYPE_Count
        {
            get
            {
                return (((UPnPModeratedStateVariable)_S.GetUPnPService().GetStateVariableObject("A_ARG_TYPE_Count")).ModerationPeriod);
            }
            set
            {
                ((UPnPModeratedStateVariable)_S.GetUPnPService().GetStateVariableObject("A_ARG_TYPE_Count")).ModerationPeriod = value;
            }
        }
        public UPnPModeratedStateVariable.IAccumulator Accumulator_A_ARG_TYPE_Result
        {
            get
            {
                return (((UPnPModeratedStateVariable)_S.GetUPnPService().GetStateVariableObject("A_ARG_TYPE_Result")).Accumulator);
            }
            set
            {
                ((UPnPModeratedStateVariable)_S.GetUPnPService().GetStateVariableObject("A_ARG_TYPE_Result")).Accumulator = value;
            }
        }
        public double ModerationDuration_A_ARG_TYPE_Result
        {
            get
            {
                return (((UPnPModeratedStateVariable)_S.GetUPnPService().GetStateVariableObject("A_ARG_TYPE_Result")).ModerationPeriod);
            }
            set
            {
                ((UPnPModeratedStateVariable)_S.GetUPnPService().GetStateVariableObject("A_ARG_TYPE_Result")).ModerationPeriod = value;
            }
        }
        public delegate void Delegate_Browse(System.String ObjectID, ContentDirectoryService.Enum_A_ARG_TYPE_BrowseFlag BrowseFlag, System.String Filter, System.UInt32 StartingIndex, System.UInt32 RequestedCount, System.String SortCriteria, out System.String Result, out System.UInt32 NumberReturned, out System.UInt32 TotalMatches, out System.UInt32 UpdateID);
        public delegate void Delegate_DestroyObject(System.String ObjectID);
        public delegate void Delegate_GetSearchCapabilities(out System.String SearchCaps);
        public delegate void Delegate_GetSortCapabilities(out System.String SortCaps);
        public delegate void Delegate_GetSystemUpdateID(out System.UInt32 Id);
        public delegate void Delegate_Search(System.String ContainerID, System.String SearchCriteria, System.String Filter, System.UInt32 StartingIndex, System.UInt32 RequestedCount, System.String SortCriteria, out System.String Result, out System.UInt32 NumberReturned, out System.UInt32 TotalMatches, out System.UInt32 UpdateID);

        public Delegate_Browse External_Browse = null;
        public Delegate_DestroyObject External_DestroyObject = null;
        public Delegate_GetSearchCapabilities External_GetSearchCapabilities = null;
        public Delegate_GetSortCapabilities External_GetSortCapabilities = null;
        public Delegate_GetSystemUpdateID External_GetSystemUpdateID = null;
        public Delegate_Search External_Search = null;

        public void RemoveStateVariable_SearchCapabilities()
        {
            _S.GetUPnPService().RemoveStateVariable(_S.GetUPnPService().GetStateVariableObject("SearchCapabilities"));
        }
        public void RemoveStateVariable_A_ARG_TYPE_SortCriteria()
        {
            _S.GetUPnPService().RemoveStateVariable(_S.GetUPnPService().GetStateVariableObject("A_ARG_TYPE_SortCriteria"));
        }
        public void RemoveStateVariable_A_ARG_TYPE_SearchCriteria()
        {
            _S.GetUPnPService().RemoveStateVariable(_S.GetUPnPService().GetStateVariableObject("A_ARG_TYPE_SearchCriteria"));
        }
        public void RemoveStateVariable_A_ARG_TYPE_Filter()
        {
            _S.GetUPnPService().RemoveStateVariable(_S.GetUPnPService().GetStateVariableObject("A_ARG_TYPE_Filter"));
        }
        public void RemoveStateVariable_SortCapabilities()
        {
            _S.GetUPnPService().RemoveStateVariable(_S.GetUPnPService().GetStateVariableObject("SortCapabilities"));
        }
        public void RemoveStateVariable_A_ARG_TYPE_ObjectID()
        {
            _S.GetUPnPService().RemoveStateVariable(_S.GetUPnPService().GetStateVariableObject("A_ARG_TYPE_ObjectID"));
        }
        public void RemoveStateVariable_SystemUpdateID()
        {
            _S.GetUPnPService().RemoveStateVariable(_S.GetUPnPService().GetStateVariableObject("SystemUpdateID"));
        }
        public void RemoveStateVariable_A_ARG_TYPE_BrowseFlag()
        {
            _S.GetUPnPService().RemoveStateVariable(_S.GetUPnPService().GetStateVariableObject("A_ARG_TYPE_BrowseFlag"));
        }
        public void RemoveStateVariable_A_ARG_TYPE_UpdateID()
        {
            _S.GetUPnPService().RemoveStateVariable(_S.GetUPnPService().GetStateVariableObject("A_ARG_TYPE_UpdateID"));
        }
        public void RemoveStateVariable_ContainerUpdateIDs()
        {
            _S.GetUPnPService().RemoveStateVariable(_S.GetUPnPService().GetStateVariableObject("ContainerUpdateIDs"));
        }
        public void RemoveStateVariable_TransferIDs()
        {
            _S.GetUPnPService().RemoveStateVariable(_S.GetUPnPService().GetStateVariableObject("TransferIDs"));
        }
        public void RemoveStateVariable_A_ARG_TYPE_Index()
        {
            _S.GetUPnPService().RemoveStateVariable(_S.GetUPnPService().GetStateVariableObject("A_ARG_TYPE_Index"));
        }
        public void RemoveStateVariable_A_ARG_TYPE_Count()
        {
            _S.GetUPnPService().RemoveStateVariable(_S.GetUPnPService().GetStateVariableObject("A_ARG_TYPE_Count"));
        }
        public void RemoveStateVariable_A_ARG_TYPE_Result()
        {
            _S.GetUPnPService().RemoveStateVariable(_S.GetUPnPService().GetStateVariableObject("A_ARG_TYPE_Result"));
        }
        public void RemoveAction_Browse()
        {
            _S.GetUPnPService().RemoveMethod("Browse");
        }
        public void RemoveAction_DestroyObject()
        {
            _S.GetUPnPService().RemoveMethod("DestroyObject");
        }
        public void RemoveAction_GetSearchCapabilities()
        {
            _S.GetUPnPService().RemoveMethod("GetSearchCapabilities");
        }
        public void RemoveAction_GetSortCapabilities()
        {
            _S.GetUPnPService().RemoveMethod("GetSortCapabilities");
        }
        public void RemoveAction_GetSystemUpdateID()
        {
            _S.GetUPnPService().RemoveMethod("GetSystemUpdateID");
        }
        public void RemoveAction_Search()
        {
            _S.GetUPnPService().RemoveMethod("Search");
        }
        public System.Net.IPEndPoint GetCaller()
        {
            return (_S.GetUPnPService().GetCaller());
        }
        public System.Net.IPEndPoint GetReceiver()
        {
            return (_S.GetUPnPService().GetReceiver());
        }

        private class _ContentDirectoryService
        {
            private ContentDirectoryService Outer = null;
            private UPnPService S;
            internal _ContentDirectoryService(ContentDirectoryService n)
            {
                Outer = n;
                S = BuildUPnPService();
            }
            public UPnPService GetUPnPService()
            {
                return (S);
            }
            public void SetStateVariable(string VarName, object VarValue)
            {
                S.SetStateVariable(VarName, VarValue);
            }
            public object GetStateVariable(string VarName)
            {
                return (S.GetStateVariable(VarName));
            }
            protected UPnPService BuildUPnPService()
            {
                UPnPStateVariable[] RetVal = new UPnPStateVariable[14];
                RetVal[0] = new UPnPModeratedStateVariable("SearchCapabilities", typeof(System.String), false);
                RetVal[0].AddAssociation("GetSearchCapabilities", "SearchCaps");
                RetVal[1] = new UPnPModeratedStateVariable("A_ARG_TYPE_SortCriteria", typeof(System.String), false);
                RetVal[1].AddAssociation("Browse", "SortCriteria");
                RetVal[1].AddAssociation("Search", "SortCriteria");
                RetVal[2] = new UPnPModeratedStateVariable("A_ARG_TYPE_SearchCriteria", typeof(System.String), false);
                RetVal[2].AddAssociation("Search", "SearchCriteria");
                RetVal[3] = new UPnPModeratedStateVariable("A_ARG_TYPE_Filter", typeof(System.String), false);
                RetVal[3].AddAssociation("Browse", "Filter");
                RetVal[3].AddAssociation("Search", "Filter");
                RetVal[4] = new UPnPModeratedStateVariable("SortCapabilities", typeof(System.String), false);
                RetVal[4].AddAssociation("GetSortCapabilities", "SortCaps");
                RetVal[5] = new UPnPModeratedStateVariable("A_ARG_TYPE_ObjectID", typeof(System.String), false);
                RetVal[5].AddAssociation("Browse", "ObjectID");
                RetVal[5].AddAssociation("DestroyObject", "ObjectID");
                RetVal[5].AddAssociation("Search", "ContainerID");
                RetVal[6] = new UPnPModeratedStateVariable("SystemUpdateID", typeof(System.UInt32), true);
                RetVal[6].AddAssociation("GetSystemUpdateID", "Id");
                RetVal[7] = new UPnPModeratedStateVariable("A_ARG_TYPE_BrowseFlag", typeof(System.String), false);
                RetVal[7].AllowedStringValues = new string[2] { "BrowseMetadata", "BrowseDirectChildren" };
                RetVal[7].AddAssociation("Browse", "BrowseFlag");
                RetVal[8] = new UPnPModeratedStateVariable("A_ARG_TYPE_UpdateID", typeof(System.UInt32), false);
                RetVal[8].AddAssociation("Browse", "UpdateID");
                RetVal[8].AddAssociation("Search", "UpdateID");
                RetVal[9] = new UPnPModeratedStateVariable("ContainerUpdateIDs", typeof(System.String), true);
                RetVal[10] = new UPnPModeratedStateVariable("TransferIDs", typeof(System.String), true);
                RetVal[11] = new UPnPModeratedStateVariable("A_ARG_TYPE_Index", typeof(System.UInt32), false);
                RetVal[11].AddAssociation("Browse", "StartingIndex");
                RetVal[11].AddAssociation("Search", "StartingIndex");
                RetVal[12] = new UPnPModeratedStateVariable("A_ARG_TYPE_Count", typeof(System.UInt32), false);
                RetVal[12].AddAssociation("Browse", "RequestedCount");
                RetVal[12].AddAssociation("Browse", "NumberReturned");
                RetVal[12].AddAssociation("Browse", "TotalMatches");
                RetVal[12].AddAssociation("Search", "RequestedCount");
                RetVal[12].AddAssociation("Search", "NumberReturned");
                RetVal[12].AddAssociation("Search", "TotalMatches");
                RetVal[13] = new UPnPModeratedStateVariable("A_ARG_TYPE_Result", typeof(System.String), false);
                RetVal[13].AddAssociation("Browse", "Result");
                RetVal[13].AddAssociation("Search", "Result");

                UPnPService S = new UPnPService(1, "urn:schemas-upnp-org:service:ContentDirectory", URN, true, this);
                for (int i = 0; i < RetVal.Length; ++i)
                {
                    S.AddStateVariable(RetVal[i]);
                }
                S.AddMethod("Browse");
                S.AddMethod("DestroyObject");
                S.AddMethod("GetSearchCapabilities");
                S.AddMethod("GetSortCapabilities");
                S.AddMethod("GetSystemUpdateID");
                S.AddMethod("Search");
                return (S);
            }

            public void Browse(System.String ObjectID, System.String BrowseFlag, System.String Filter, System.UInt32 StartingIndex, System.UInt32 RequestedCount, System.String SortCriteria, out System.String Result, out System.UInt32 NumberReturned, out System.UInt32 TotalMatches, out System.UInt32 UpdateID)
            {
                Enum_A_ARG_TYPE_BrowseFlag e_BrowseFlag;
                switch (BrowseFlag)
                {
                    case "BrowseMetadata":
                        e_BrowseFlag = Enum_A_ARG_TYPE_BrowseFlag.BROWSEMETADATA;
                        break;
                    case "BrowseDirectChildren":
                        e_BrowseFlag = Enum_A_ARG_TYPE_BrowseFlag.BROWSEDIRECTCHILDREN;
                        break;
                    default:
                        e_BrowseFlag = 0;
                        break;
                }
                if (Outer.External_Browse != null)
                {
                    Outer.External_Browse(ObjectID, e_BrowseFlag, Filter, StartingIndex, RequestedCount, SortCriteria, out Result, out NumberReturned, out TotalMatches, out UpdateID);
                }
                else
                {
                    Sink_Browse(ObjectID, e_BrowseFlag, Filter, StartingIndex, RequestedCount, SortCriteria, out Result, out NumberReturned, out TotalMatches, out UpdateID);
                }
            }
            public void DestroyObject(System.String ObjectID)
            {
                if (Outer.External_DestroyObject != null)
                {
                    Outer.External_DestroyObject(ObjectID);
                }
                else
                {
                    Sink_DestroyObject(ObjectID);
                }
            }
            public void GetSearchCapabilities(out System.String SearchCaps)
            {
                if (Outer.External_GetSearchCapabilities != null)
                {
                    Outer.External_GetSearchCapabilities(out SearchCaps);
                }
                else
                {
                    Sink_GetSearchCapabilities(out SearchCaps);
                }
            }
            public void GetSortCapabilities(out System.String SortCaps)
            {
                if (Outer.External_GetSortCapabilities != null)
                {
                    Outer.External_GetSortCapabilities(out SortCaps);
                }
                else
                {
                    Sink_GetSortCapabilities(out SortCaps);
                }
            }
            public void GetSystemUpdateID(out System.UInt32 Id)
            {
                if (Outer.External_GetSystemUpdateID != null)
                {
                    Outer.External_GetSystemUpdateID(out Id);
                }
                else
                {
                    Sink_GetSystemUpdateID(out Id);
                }
            }
            public void Search(System.String ContainerID, System.String SearchCriteria, System.String Filter, System.UInt32 StartingIndex, System.UInt32 RequestedCount, System.String SortCriteria, out System.String Result, out System.UInt32 NumberReturned, out System.UInt32 TotalMatches, out System.UInt32 UpdateID)
            {
                if (Outer.External_Search != null)
                {
                    Outer.External_Search(ContainerID, SearchCriteria, Filter, StartingIndex, RequestedCount, SortCriteria, out Result, out NumberReturned, out TotalMatches, out UpdateID);
                }
                else
                {
                    Sink_Search(ContainerID, SearchCriteria, Filter, StartingIndex, RequestedCount, SortCriteria, out Result, out NumberReturned, out TotalMatches, out UpdateID);
                }
            }

            public Delegate_Browse Sink_Browse;
            public Delegate_DestroyObject Sink_DestroyObject;
            public Delegate_GetSearchCapabilities Sink_GetSearchCapabilities;
            public Delegate_GetSortCapabilities Sink_GetSortCapabilities;
            public Delegate_GetSystemUpdateID Sink_GetSystemUpdateID;
            public Delegate_Search Sink_Search;
        }
        public ContentDirectoryService()
        {
            _S = new _ContentDirectoryService(this);
            _S.GetUPnPService().GetStateVariableObject("SearchCapabilities").OnModified += new UPnPStateVariable.ModifiedHandler(OnModifiedSink_SearchCapabilities);
            _S.GetUPnPService().GetStateVariableObject("A_ARG_TYPE_SortCriteria").OnModified += new UPnPStateVariable.ModifiedHandler(OnModifiedSink_A_ARG_TYPE_SortCriteria);
            _S.GetUPnPService().GetStateVariableObject("A_ARG_TYPE_SearchCriteria").OnModified += new UPnPStateVariable.ModifiedHandler(OnModifiedSink_A_ARG_TYPE_SearchCriteria);
            _S.GetUPnPService().GetStateVariableObject("A_ARG_TYPE_Filter").OnModified += new UPnPStateVariable.ModifiedHandler(OnModifiedSink_A_ARG_TYPE_Filter);
            _S.GetUPnPService().GetStateVariableObject("SortCapabilities").OnModified += new UPnPStateVariable.ModifiedHandler(OnModifiedSink_SortCapabilities);
            _S.GetUPnPService().GetStateVariableObject("A_ARG_TYPE_ObjectID").OnModified += new UPnPStateVariable.ModifiedHandler(OnModifiedSink_A_ARG_TYPE_ObjectID);
            _S.GetUPnPService().GetStateVariableObject("SystemUpdateID").OnModified += new UPnPStateVariable.ModifiedHandler(OnModifiedSink_SystemUpdateID);
            _S.GetUPnPService().GetStateVariableObject("A_ARG_TYPE_BrowseFlag").OnModified += new UPnPStateVariable.ModifiedHandler(OnModifiedSink_A_ARG_TYPE_BrowseFlag);
            _S.GetUPnPService().GetStateVariableObject("A_ARG_TYPE_UpdateID").OnModified += new UPnPStateVariable.ModifiedHandler(OnModifiedSink_A_ARG_TYPE_UpdateID);
            _S.GetUPnPService().GetStateVariableObject("ContainerUpdateIDs").OnModified += new UPnPStateVariable.ModifiedHandler(OnModifiedSink_ContainerUpdateIDs);
            _S.GetUPnPService().GetStateVariableObject("TransferIDs").OnModified += new UPnPStateVariable.ModifiedHandler(OnModifiedSink_TransferIDs);
            _S.GetUPnPService().GetStateVariableObject("A_ARG_TYPE_Index").OnModified += new UPnPStateVariable.ModifiedHandler(OnModifiedSink_A_ARG_TYPE_Index);
            _S.GetUPnPService().GetStateVariableObject("A_ARG_TYPE_Count").OnModified += new UPnPStateVariable.ModifiedHandler(OnModifiedSink_A_ARG_TYPE_Count);
            _S.GetUPnPService().GetStateVariableObject("A_ARG_TYPE_Result").OnModified += new UPnPStateVariable.ModifiedHandler(OnModifiedSink_A_ARG_TYPE_Result);
            _S.Sink_Browse = new Delegate_Browse(Browse);
            _S.Sink_DestroyObject = new Delegate_DestroyObject(DestroyObject);
            _S.Sink_GetSearchCapabilities = new Delegate_GetSearchCapabilities(GetSearchCapabilities);
            _S.Sink_GetSortCapabilities = new Delegate_GetSortCapabilities(GetSortCapabilities);
            _S.Sink_GetSystemUpdateID = new Delegate_GetSystemUpdateID(GetSystemUpdateID);
            _S.Sink_Search = new Delegate_Search(Search);
        }
        public ContentDirectoryService(string ID)
            : this()
        {
            _S.GetUPnPService().ServiceID = ID;
        }
        public UPnPService GetUPnPService()
        {
            return (_S.GetUPnPService());
        }
        private void OnModifiedSink_SearchCapabilities(UPnPStateVariable sender, object NewValue)
        {
            if (OnStateVariableModified_SearchCapabilities != null) OnStateVariableModified_SearchCapabilities(this);
        }
        private void OnModifiedSink_A_ARG_TYPE_SortCriteria(UPnPStateVariable sender, object NewValue)
        {
            if (OnStateVariableModified_A_ARG_TYPE_SortCriteria != null) OnStateVariableModified_A_ARG_TYPE_SortCriteria(this);
        }
        private void OnModifiedSink_A_ARG_TYPE_SearchCriteria(UPnPStateVariable sender, object NewValue)
        {
            if (OnStateVariableModified_A_ARG_TYPE_SearchCriteria != null) OnStateVariableModified_A_ARG_TYPE_SearchCriteria(this);
        }
        private void OnModifiedSink_A_ARG_TYPE_Filter(UPnPStateVariable sender, object NewValue)
        {
            if (OnStateVariableModified_A_ARG_TYPE_Filter != null) OnStateVariableModified_A_ARG_TYPE_Filter(this);
        }
        private void OnModifiedSink_SortCapabilities(UPnPStateVariable sender, object NewValue)
        {
            if (OnStateVariableModified_SortCapabilities != null) OnStateVariableModified_SortCapabilities(this);
        }
        private void OnModifiedSink_A_ARG_TYPE_ObjectID(UPnPStateVariable sender, object NewValue)
        {
            if (OnStateVariableModified_A_ARG_TYPE_ObjectID != null) OnStateVariableModified_A_ARG_TYPE_ObjectID(this);
        }
        private void OnModifiedSink_SystemUpdateID(UPnPStateVariable sender, object NewValue)
        {
            if (OnStateVariableModified_SystemUpdateID != null) OnStateVariableModified_SystemUpdateID(this);
        }
        private void OnModifiedSink_A_ARG_TYPE_BrowseFlag(UPnPStateVariable sender, object NewValue)
        {
            if (OnStateVariableModified_A_ARG_TYPE_BrowseFlag != null) OnStateVariableModified_A_ARG_TYPE_BrowseFlag(this);
        }
        private void OnModifiedSink_A_ARG_TYPE_UpdateID(UPnPStateVariable sender, object NewValue)
        {
            if (OnStateVariableModified_A_ARG_TYPE_UpdateID != null) OnStateVariableModified_A_ARG_TYPE_UpdateID(this);
        }
        private void OnModifiedSink_ContainerUpdateIDs(UPnPStateVariable sender, object NewValue)
        {
            if (OnStateVariableModified_ContainerUpdateIDs != null) OnStateVariableModified_ContainerUpdateIDs(this);
        }
        private void OnModifiedSink_TransferIDs(UPnPStateVariable sender, object NewValue)
        {
            if (OnStateVariableModified_TransferIDs != null) OnStateVariableModified_TransferIDs(this);
        }
        private void OnModifiedSink_A_ARG_TYPE_Index(UPnPStateVariable sender, object NewValue)
        {
            if (OnStateVariableModified_A_ARG_TYPE_Index != null) OnStateVariableModified_A_ARG_TYPE_Index(this);
        }
        private void OnModifiedSink_A_ARG_TYPE_Count(UPnPStateVariable sender, object NewValue)
        {
            if (OnStateVariableModified_A_ARG_TYPE_Count != null) OnStateVariableModified_A_ARG_TYPE_Count(this);
        }
        private void OnModifiedSink_A_ARG_TYPE_Result(UPnPStateVariable sender, object NewValue)
        {
            if (OnStateVariableModified_A_ARG_TYPE_Result != null) OnStateVariableModified_A_ARG_TYPE_Result(this);
        }
        //}}}}} End of Code Block

        #endregion

        /// <summary>
        /// Action: Browse
        /// </summary>
        /// <param name="objectID">Associated State Variable: A_ARG_TYPE_ObjectID</param>
        /// <param name="browseFlag">Associated State Variable: A_ARG_TYPE_BrowseFlag</param>
        /// <param name="filter">Associated State Variable: A_ARG_TYPE_Filter</param>
        /// <param name="startingIndex">Associated State Variable: A_ARG_TYPE_Index</param>
        /// <param name="requestedCount">Associated State Variable: A_ARG_TYPE_Count</param>
        /// <param name="sortCriteria">Associated State Variable: A_ARG_TYPE_SortCriteria</param>
        /// <param name="result">Associated State Variable: A_ARG_TYPE_Result</param>
        /// <param name="numberReturned">Associated State Variable: A_ARG_TYPE_Count</param>
        /// <param name="totalMatches">Associated State Variable: A_ARG_TYPE_Count</param>
        /// <param name="updateID">Associated State Variable: A_ARG_TYPE_UpdateID</param>
        public virtual void Browse(String objectID, Enum_A_ARG_TYPE_BrowseFlag browseFlag, String filter, UInt32 startingIndex,
            UInt32 requestedCount, String sortCriteria, out String result, out UInt32 numberReturned, out UInt32 totalMatches,
            out UInt32 updateID)
        {
            result = String.Empty;
            numberReturned = 0;
            totalMatches = 0;
            updateID = 0;
        }

        /// <summary>
        /// Action: DestroyObject
        /// </summary>
        /// <param name="objectID">Associated State Variable: A_ARG_TYPE_ObjectID</param>
        public virtual void DestroyObject(String objectID)
        {
        }

        /// <summary>
        /// Action: GetSearchCapabilities
        /// </summary>
        /// <param name="searchCaps">Associated State Variable: SearchCapabilities</param>
        public virtual void GetSearchCapabilities(out String searchCaps)
        {
            searchCaps = String.Empty;
        }

        /// <summary>
        /// Action: GetSortCapabilities
        /// </summary>
        /// <param name="sortCaps">Associated State Variable: SortCapabilities</param>
        public void GetSortCapabilities(out String sortCaps)
        {
            sortCaps = String.Empty;
        }

        /// <summary>
        /// Action: GetSystemUpdateID
        /// </summary>
        /// <param name="id">Associated State Variable: SystemUpdateID</param>
        public virtual void GetSystemUpdateID(out UInt32 id)
        {
            id = 0;
        }

        /// <summary>
        /// Action: Search
        /// </summary>
        /// <param name="containerID">Associated State Variable: A_ARG_TYPE_ObjectID</param>
        /// <param name="searchCriteria">Associated State Variable: A_ARG_TYPE_SearchCriteria</param>
        /// <param name="filter">Associated State Variable: A_ARG_TYPE_Filter</param>
        /// <param name="startingIndex">Associated State Variable: A_ARG_TYPE_Index</param>
        /// <param name="requestedCount">Associated State Variable: A_ARG_TYPE_Count</param>
        /// <param name="sortCriteria">Associated State Variable: A_ARG_TYPE_SortCriteria</param>
        /// <param name="result">Associated State Variable: A_ARG_TYPE_Result</param>
        /// <param name="numberReturned">Associated State Variable: A_ARG_TYPE_Count</param>
        /// <param name="totalMatches">Associated State Variable: A_ARG_TYPE_Count</param>
        /// <param name="updateID">Associated State Variable: A_ARG_TYPE_UpdateID</param>
        public virtual void Search(string containerID, string searchCriteria, string filter, uint startingIndex,
            uint requestedCount, string sortCriteria, out string result, out uint numberReturned, out uint totalMatches,
            out uint updateID)
        {
            Browse(containerID, Enum_A_ARG_TYPE_BrowseFlag.BROWSEDIRECTCHILDREN, filter, startingIndex, requestedCount, sortCriteria,
                out result, out numberReturned, out totalMatches, out updateID);
        }
    }
}
